package photoEffects
{
	import mx.collections.ArrayCollection;
	import mx.controls.Alert;
	
	public class PhotoEffectUtil
	{
		[Bindable]
		public static var allAvalibleEffectClasses:ArrayCollection = new ArrayCollection([PinHoleCameraEffect,CrossProcessingEffect,GhostEffect,DistortFaceEffect]);
		
		public static function getEffectClassByName(name:String):Class{
			for each (var effclass:Class in allAvalibleEffectClasses){
				if (effclass.NAME == name){
					return effclass;
				}
			}
			return null;
		}
		
		public static function dumpEffects(effects:ArrayCollection):String {
        	var r:String = "";
        	for (var i:int = 0 ; i < effects.length ; i++){
        		if (i > 0) r+= ','
        		r += (effects.getItemAt(i) as Object).constructor.NAME;
        	}
        	return r;
        }
	}
}